#ifndef __TOUCHABLE__
#define __TOUCHABLE__

#include <ode/ode.h>

#include "Renderable.hh"



class Touchable: public Renderable{
  
public:
  Touchable();
  Touchable(const std::string& name, double x, double y, double z, const char* md3file, double mass, double velx, double vely, double velz);
  
  Touchable& operator=(const Touchable& t);
  
  void on_AddWorld(dWorldID world, dSpaceID space);

  void SetPos(double x, double y, double z);
  
  void SetMass(double mass);

  void SetVel(double velx, double vely, double velz);

  void Render();

  double GetMass();

  ~Touchable();
  

  double mVelx;
  double mVely;
  double mVelz;

private:
  double mMass;
  
  dBodyID mOdeBody;	
  dGeomID mOdeGeom;	
  dMass   mOdeMass;
  dTriMeshDataID mtriMesh;

  static dWorldID sOdeWorld;
  static dSpaceID sSpace;

  int mLastMatrixIndex;
  dReal mMatrixDblBuf[ 16 * 2 ];

  bool mUsable;

  //--Extra
  dTriIndex* tri;
  dVector3* triVert;  


};


#endif
